package com.soft.javase.day06;

import java.util.Scanner;

/**
 * @author yzg
 * @desc TODO
 * @date 2025/4/24
 */
public class Wrapper {
    public static void main(String[] args) {
        double a = 12.5;
        String strA = String.valueOf(a);
        String result1 = strA + "10";
        System.out.println("a转换为String类型后+10的结果为:"+result1);

        String str = "2.8";
        double num = Double.parseDouble(str);
        double result2 = num + 10;
        System.out.println("str转换为double型后+10的结果为:" + result2);


        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入一个字符串: ");
        String inputStr = scanner.nextLine();

        int lowercaseCount = 0;
        int uppercaseCount = 0;
        int digitCount = 0;

        for (int i = 0; i < inputStr.length(); i++) {
            char c = inputStr.charAt(i);
            if (Character.isLowerCase(c)) {
                lowercaseCount++;
            } else if (Character.isUpperCase(c)) {
                uppercaseCount++;
            } else if (Character.isDigit(c)) {
                digitCount++;
            }
        }

        System.out.println("小写字母个数: " + lowercaseCount);
        System.out.println("大写字母个数: " + uppercaseCount);
        System.out.println("数字个数: " + digitCount);
    }
}
